define(["ajaxBase","login-out"], function (ajaxBase,logout) {
    function setUserDetail(data) {
        document.querySelector(".user-getInfo").src = data.statusMag.imageUrl
        document.querySelector(".user-img img").src = data.statusMag.imageUrl
        document.querySelector(".user-name").innerText = data.statusMag.username
        document.querySelector(".user-getInfo").style.display = "inline-block"
        document.querySelector(".user-img img").style.display = "inline-block"
    }

    function setUserInfo() {
        let url = "/login/userInfo",
            data = {
                pageNum: 1,
                pageSize: 6,
                orderByField: "id"
            },
            method = "POST"
        ajaxBase(data, url, method).then(function (msg) {
            setUserDetail(msg)
            logout()
        })
    }

    return setUserInfo
})